package com.spring.boot.mutou;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.context.ApplicationEvent;
import org.springframework.context.ApplicationListener;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@EnableAutoConfiguration
public class TestController {

	private static Logger logger = LoggerFactory.getLogger(TestController.class);
	@RequestMapping("/")
	public String home()throws Exception{
		throw new NullPointerException("====");
		//return "hello world";
	}
	
	public static void main(String[] args) {
		/*ApplicationListener<ApplicationEvent> list = null;
		 添加监听器 
		new SpringApplication().addListeners(list);
		new SpringApplicationBuilder().listeners(list);
		*/
		
		SpringApplication.run(new Object [] {TestController.class}, args);
		logger.debug("debug ...");
		logger.info("info ...");
		logger.warn("warn ...");
		logger.error("error ...");
	}
}
